<?php 
$page_title="Administrator";
require_once('../auth/auth.php');
include('templates/header.php'); 
     
// Accesses database                                    
 include 'db/db_Connect.php';
 	$volunteers = mysql_query("SELECT * from User WHERE active_status = '0'");
 	$volunteers_pending = mysql_num_rows($volunteers);  
 	$users = mysql_query("SELECT * from User WHERE NOT (user_type = 2)");
 	$staff = mysql_num_rows($users); 
 	
 	$families = mysql_query("SELECT * from Families");
 	$total_families = mysql_num_rows($families);  
 	$unadopted = mysql_query("SELECT * from Families WHERE adoptive_family_user IS NULL");
 	$total_unadopted = mysql_num_rows($unadopted);  
 	
 	$adopters = mysql_query("SELECT * from User WHERE user_type = '2'");
 	$total_adopters = mysql_num_rows($adopters);  
 	$unmatched = mysql_query("SELECT * from User WHERE user_type='2' AND family_in_need_match IS NULL");
 	$total_unmatched = mysql_num_rows($unmatched);       
 	                                                                          
 include 'db/db_Close.php';                                                                                      
                                                       
?>

<div class="sortable row-fluid">
				<a data-rel="tooltip" title= "<?php echo $volunteers_pending; ?> pending accounts" class="well span3 top-block" href="staff.php">
					<span class="icon32 icon-red icon-user"></span>
					<div>Total St. Vincent Staff</div>
					<div><?php echo $staff; ?></div>
					<?php if ($volunteers_pending != 0) { ?>
						<span class="notification"><?php echo $volunteers_pending; ?></span>
					<?php } ?>				
				</a>
				
				<a data-rel="tooltip" title= "<?php echo  $total_unadopted; ?> unadopted families" class="well span3 top-block" href="families.php">
					<span class="icon32 icon-blue icon-user"></span>
					<div>Total Families</div>
					<div><?php echo $total_families; ?></div>
					<?php if ($total_unadopted != 0) { ?>
						<span class="notification"><?php echo $total_unadopted ; ?></span>
					<?php } ?>				
				</a>
				
				<a data-rel="tooltip" title= "<?php echo $total_unmatched; ?> unmatched adopters" class="well span3 top-block" href="adopters.php">
					<span class="icon32 icon-green icon-user"></span>
					<div>Total Adoptors</div>
					<div><?php echo $total_adopters; ?></div>
					<?php if ($total_unmatched != 0) { ?>
						<span class="notification"><?php echo $total_unmatched; ?></span>
					<?php } ?>				
				</a>

			<div class="row-fluid sortable">
				<div class="box span12">
					<div class="box-header well" data-original-title>
						<h2><i class="icon-folder-open"></i> Summary</h2>
						<div class="box-icon">
							<a href="#" class="btn btn-setting btn-round"><i class="icon-cog"></i></a>
							<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
						</div>
					</div>
					<div class="box-content">
					
					<a href="https://code.google.com/p/st-vincent-christmas-program/source/browse/trunk/app/administrator.php">Administrator Dashboard Code</a>
					<br />
					<br />
					<a href="https://code.google.com/p/st-vincent-christmas-program/source/browse/trunk/app/db/StaffTable.php">Staff DataTable</a>					
					
						
					</div>
				</div><!--/span-->
			
			</div><!--/row-->
	</div>

    
<?php include('templates/footer.php'); ?>
